package daily;

import java.util.Scanner;

public class MeiTuan02_1 {

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        StringBuilder sb = new StringBuilder(s);
        for(int i = 0; i < s.length()-1; i++){
            sb.insert(s.length(), s.charAt(i));
            if(isReCircleString(sb.toString())){
                System.out.println(sb.length()-s.length());
                break;
            }
        }
    }

    private static boolean isReCircleString(String s){
        boolean flag = true;
        for(int i = 0; i < s.length(); i++){
            if(s.charAt(i) != s.charAt(s.length()-i-1)){
                flag = false;
                break;
            }
        }
        return flag;
    }
}
